package cn.edu.stu.syllabus.utils;

import retrofit2.Retrofit;
import retrofit2.adapter.rxjava.RxJavaCallAdapterFactory;
import retrofit2.converter.gson.GsonConverterFactory;

/**
 * Created by daidaijie on 2017/3/10.
 */

public class BmobRetrofit {
    private Retrofit mRetrofit;

    private BmobRetrofit() {
        mRetrofit = new Retrofit.Builder()
                .baseUrl("https://api.bmob.cn/1/")
                .addCallAdapterFactory(RxJavaCallAdapterFactory.create())
                .addConverterFactory(GsonConverterFactory.create())
                .build();
    }

    public static Retrofit getRetrofit() {
        return BmobRetrofitHolder.sBmobRetrofit.mRetrofit;
    }

    private static class BmobRetrofitHolder {
        public static BmobRetrofit sBmobRetrofit = new BmobRetrofit();
    }

}
